<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/page/share/taglib.jsp" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">

    <title>主页</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

    <link type="text/css" rel="stylesheet" href="css/index.css">
    <link type="text/css" rel="stylesheet" href="css/smartmenu.css">
    <script type="text/javascript" src="jslib/index/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="jslib/index/smartmenu-min.js"></script>
    <script type="text/javascript">
        jQuery(window).ready(function () {
            jQuery("#navigation").Smartmenu({animationDuration:350});
        });
        SyntaxHighlighter.all();
    </script>
    <script src='jslib/qqkf/qqonline.js' language='JavaScript'></script>
</head>
<script type="text/javascript">
    function test() {
        var oWatermark = document.getElementById('login');
        var scrollTop = document.documentElement.scrollTop + document.body.scrollTop + 200;
        oWatermark.style.top = scrollTop + 'px';
        var scrollLeft = document.documentElement.scrollRight + document.body.scrollRight + 0;
        oWatermark.style.left = scrollLeft + 'px';
    }
    window.onscroll = test;
</script>

<body>
<div id="top">
    <div id="logo"></div>
    <div id="top_custom">
        <security:authentication property="name"/>
        welcome!
        <security:authentication property="authorities" var="authorities"/>
        <a href="${pageContext.request.contextPath}/j_spring_security_logout" id="logout">&nbsp;&nbsp;退出</a>
        <c:forEach items="${authorities}" var="authority">
            <c:set var="a" value="${authority.authority}" scope="session"/>
        </c:forEach>
    </div>

</div>
</br></br>

<div id="menu">
    <div id="wrap">
        <div id="navigation" class="smartmenu">
            <ul>
                <li style="border-top: 8px solid rgb(177,37,38);">
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="">用户资料</a>
                    <ul>
                        <c:if test="${a=='ROLE_ADMIN'}">
                            <li>
                                <form method="post" action="Person.action">
                                    <input name="personManage" type="submit" value="内部用户管理"/>
                                </form>
                            </li>
                            <li>
                                <form method="post" action="Person!userList.action">
                                    <input name="personManage" type="submit" value="普通用户管理"/>
                                </form>
                            </li>
                            <li>
                                <form method="post" action="/page/person/addPerson.jsp">
                                    <input name="personManage" type="submit" value="添加用户"/>
                                </form>
                            </li>
                        </c:if>
                        <li>
                            <form method="post" action="/page/person/changePassword.jsp">
                                <input name="uploadFile" type="submit" value="修改密码"/>
                            </form>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="">套餐</a>
                    <ul>
                        <li>
                            <form method="post" action="Meal.action">
                                <input name="allMeal" type="submit" value="全部套餐"/>
                            </form>
                        </li>
                        <c:if test="${a!='ROLE_USER'}">
                            <c:if test="${a!='ROLE_STAFF'}">
                                <li>
                                    <form method="post" action="/page/meal/OneMeal.jsp">
                                        <input name="oneMeal" type="submit" value="修改套餐"/>
                                    </form>
                                </li>
                                <li>
                                    <form method="post" action="/page/meal/AddMeal.jsp">
                                        <input name="addMeal" type="submit" value="添加套餐"/>
                                    </form>
                                </li>
                                <%-- <li>
                                    <form method="post" action="/page/meal/setMealPrice.jsp">
                                        <input name="setMealPrice" type="submit" value="修改价格"/>
                                    </form>
                                </li>--%>
                            </c:if>
                        </c:if>
                        <li>
                            <form method="post" action="/page/meal/findMeal.jsp">
                                <input name="findMeal" type="submit" value="查找套餐"/>
                            </form>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="">预约</a>
                    <ul>
                        <li>
                            <form method="post" action="/page/order/AddOrder.jsp">
                                <input name="findRoomPrice" type="submit" value="添加预约"/>
                            </form>
                        </li>
                        <c:if test="${a!='ROLE_USER'}">
                            <li>
                                <form method="post" action="Order!findNotAuditOrder.action">
                                    <input name="findNotAuditOrder" type="submit" value="查看未审核预约"/>
                                </form>
                            </li>
                        </c:if>
                        <li>
                            <form method="post" action="/page/order/findOrder.jsp">
                                <input name="findRoomPrice" type="submit" value="查找预约"/>
                            </form>
                        </li>
                        <li>
                            <form method="post" action="/page/order/CancelOrder.jsp">
                                <input name="cancelOrder" type="submit" value="取消预约"/>
                            </form>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="">网友互动</a>
                    <ul>
                        <li>
                            <form method="post" action="/page/file/uploadFile.jsp">
                                <input name="uploadFile" type="submit" value="上传文件"/>
                            </form>
                        </li>
                        <li>
                            <form method="post" action="Evaluate.action">
                                <input name="evaluate" type="submit" value="网友评价"/>
                            </form>
                        </li>
                    </ul>
                </li>
                <c:if test="${a!='ROLE_USER'}">
                <li>
                    <a href="">房间</a>
                    <ul>
                        <li>
                            <form method="post" action="RoomUsed!AllRoom.action">
                                <input name="allRooms" type="submit" value="房间列表"/>
                            </form>
                        </li>
                        <li>
                            <form method="post" action="/page/roomUsed/arrangeRoom.jsp">
                                <input name="arrangeRoom" type="submit" value="房间安排"/>
                            </form>
                        </li>
                    </ul>
                </li>
                </c:if>
                <c:if test="${a!='ROLE_USER'}">
                <li>
                    <a href="">收费</a>
                    <ul>
                        <li>
                            <form method="post" action="/page/roomUsed/calPrice.jsp">
                                <input name="calPrice" type="submit" value="计算费用"/>
                            </form>
                        </li>
                        <li>
                            <form method="post" action="/page/roomUsed/extraMoney.jsp">
                                <input name="extraMoney" type="submit" value="额外费用"/>
                            </form>
                        </li>
                        <c:if test="${a!='ROLE_STAFF'}">
                            <li>
                                <form method="post" action="/page/roomUsed/revenue.jsp">
                                    <input name="extraMoney" type="submit" value="营业额"/>
                                </form>
                            </li>
                        </c:if>
                    </ul>
                </li>
                </c:if>
                <c:if test="${a=='ROLE_ADMIN'}">
                <li>
                    <a href="">数据操作</a>
                    <ul>
                        <li>
                            <form method="post" action="page/file/DateOperation.jsp">
                                <input name="excel" type="submit" value="数据操作"/>
                            </form>
                        </li>
                    </ul>
                </li>
                </c:if>
        </div>
    </div>
</div>
<div id="content">

</div>
<div id=bottom>
    <ul>
        <li>
            联系我们：
                <a href="mailto:willsonz@qq.com?subject=KTV综合管理系统">willsonz@qq.com</a>

        </li>
    </ul>
    <ul>
        <li>
            ©&nbsp;Made By Cloud Team.

        </li>
    </ul>
</div>


<!--链接上加上onclick命令，点击后执行showPanel()函数，名称应和javascript中设置相同-->
<DIV id=Panel style="DISPLAY: none"><!--图层ID为panel，javascript代码将会调用，如果修改，请和javascript代码中的一致，首先层设置为不显示*-->
    <A style="DISPLAY: block; FLOAT: right; font-size:20px; color:#2ddfdf; padding-right:8px; font-family:Verdana"
       onclick=hidePanel(); href="#">X</A> <!-- 一个关闭此层的链接，点击后调用hidePanel()函数*-->
    <IFRAME id=frame style="OVERFLOW-X: hidden" src="login.jsp" frameBorder=0 width=450 scrolling=no
            height=250></IFRAME>
    <!--内嵌框架，ID为frame，如果修改须和javascript代码中的名称一致，框架边框、宽度、高度、是否显示滚动条可自行修改-->
</DIV>

<SCRIPT>
    var forEach = function (array, callback, thisObject) {
        if (array.forEach) {
            array.forEach(callback, thisObject);
        } else {
            for (var i = 0,
                         len = array.length; i < len; i++) {
                callback.call(thisObject, array[i], i, array);
            }
        }
    }
    var st = new SlideTrans("idContainer2", "idSlider2", 5, {
        Vertical:false
    });
    var nums = [];
    //插入数字
    for (var i = 0,
                 n = st._count - 1; i <= n;) {
        (nums[i] = $("idNum").appendChild(document.createElement("li"))).innerHTML = ++i;
    }
    forEach(nums,
            function (o, i) {
                o.onmouseover = function () {
                    o.className = "on";
                    st.Auto = false;
                    st.Run(i);
                }
                o.onmouseout = function () {
                    o.className = "";
                    st.Auto = true;
                    st.Run();
                }
            })
    //设置按钮样式
    st.onStart = function () {
        forEach(nums,
                function (o, i) {
                    o.className = st.Index == i ? "on" : "";
                })
    }
    st.Run();
</SCRIPT>

</body>
</html>
